package com.mq.config;

import org.springframework.amqp.core.DirectExchange;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * rabbitmq配置
 * @author gxd
 * @since 2025/6/8
 */
@Configuration
public class RabbitMqConfig {

    @Value("${mq.exchange-name}")
    private String exchangeName;

    // 直连交换机
    @Bean
    public DirectExchange directExchange() {
        return new DirectExchange(exchangeName);
    }
}
